﻿using System;
using System.Collections.Generic;
using System.Text;
using WebHacker;

namespace PosHacker.Form
{
    public class POSForm:XMLHttpForm
    {
        public string[] ParseOnClick(string strOnClick ,string pStr) {
            //strOnClick = strOnClick.Substring(0, strOnClick.IndexOf("type=button"));
            //strOnClick = strOnClick.ToLower();

            if (strOnClick.Contains("')\""))//searsh
                strOnClick = strOnClick.Substring(0, strOnClick.IndexOf("')\""));

            //if (strOnClick.Contains("name=set value=Set type=button"))//searsh
            //    strOnClick = strOnClick.Substring(0, strOnClick.IndexOf("name=set value=Set type=button"));
            //else if (strOnClick.Contains("name=selectMarkableQuestions value=Set type=button"))//PC Mark
            //    strOnClick = strOnClick.Substring(0, strOnClick.IndexOf("name=selectMarkableQuestions value=Set type=button"));
            else
            {
                throw new Exception("Html Body Parse Error : " + strOnClick);
            }

            strOnClick = strOnClick.Substring(strOnClick.IndexOf(pStr));
            strOnClick = strOnClick.Trim();
            strOnClick = strOnClick.Trim('\"');

            strOnClick = strOnClick.Replace(pStr, "");

            strOnClick = strOnClick.Trim(')');

            return strOnClick.Split(',');
        }
    }


}
